package com.example.demo.zhoushengwen.controller;


import com.example.demo.zhoushengwen.Entity.User;
import com.example.demo.zhoushengwen.response.CommonCode;
import com.example.demo.zhoushengwen.response.ResponseResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

//返回结果集测试:   localhost:8080/response/test
@RestController
@RequestMapping("/response")
public class ResponseResultController {

    @GetMapping("/test")
    public ResponseResult testResponseResult() {
        User user = new User();
        user.setName("周生文");
        user.setAge(26);
        return new ResponseResult(CommonCode.SUCCESS, user);

    }
}
